home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / PowerPlant / UWindowUsher 1.1 / UWindowsUsher.h < prev   
Encoding:
Text File  |  1995-08-28  |  3.2 KB  |  109 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. //    UWindowsUsher.h                    © 1995, Éric Forget. All rights reserved.
  3. // ===========================================================================
  4. //    
  5. //    ************************************************************************
  6. //    *                                                                      *
  7. //    *    Before using this code you should read the "License Agreement"     *
  8. //    *    document and agree with it.                                        *
  9. //    *                                                                      *
  10. //    ************************************************************************
  11. //
  12. //    Instruction and usage notes are in the UWindowsUsher.cp file.
  13. //
  14. // ---------------------------------------------------------------------------
  15.  
  16. #pragma once
  17.  
  18. #include <PP_Prefix.h>
  19. #include <LAttachment.h>
  20.  
  21. #ifndef __QUICKDRAW__
  22. #include <QuickDraw.h>
  23. #endif
  24.  
  25.  
  26. class LWindow;
  27. class LList;
  28. class LDocument;
  29.  
  30.  
  31. // ---------------------------------------------------------------------------
  32. //        • Constants
  33. // ---------------------------------------------------------------------------
  34.  
  35. const    ResIDT        Menu_Undefined        = -1;
  36. const    CommandT    cmd_StackWindows    = 30; // A reserved but unused command!
  37.  
  38.  
  39. // ===========================================================================
  40. // • UWindowsUsher                                               UWindowsUsher •
  41. // ===========================================================================
  42.  
  43. class    UWindowsUsher {
  44.  
  45. public:
  46.     static void            Initialize(ResIDT inWindowMenuID = Menu_Undefined);
  47.     static void            Dispose();
  48.     
  49.     static void            AddWindow(LWindow *inWindow, Boolean inShowIt, LDocument *inDocument = nil);
  50.     static void            RemoveWindow(LWindow *inWindow);
  51.     static Int16        GetWindowCount();
  52.     
  53.     static Boolean        IsStackEnabled();
  54.     
  55.     static void            Stack();
  56.     
  57. protected:
  58.                         // Instance variables...
  59.     static LList        *sWindowList;
  60.     static LList        *sAttachmentList;
  61.     static ResIDT        sWindowMenuID;
  62.     static LCommander    *sApplication;
  63.     static LAttachment    *sStackAttachment;
  64.     
  65.                         // Protected methods...
  66.     static void            StackAtPos(Int16 inPos, LWindow *inWindow);
  67. };
  68.  
  69.  
  70. // ===========================================================================
  71. // • LWindowMenuAttachment                               LWindowMenuAttachment •
  72. // ===========================================================================
  73.  
  74. class    LWindowMenuAttachment : public LAttachment {
  75.  
  76. private:
  77.                         LWindowMenuAttachment(); // Always need parameters...
  78.  
  79. public:
  80.                         LWindowMenuAttachment(LWindow *inWindow, ResIDT inWindowMenuID, LDocument *inDocument);
  81.     virtual                ~LWindowMenuAttachment();
  82.     
  83.     virtual    void        AttachmentHasBeenRemoved(CommandT inCommand);
  84.             CommandT    GetCommand();
  85.  
  86. protected:
  87.     LWindow                *mWindow;
  88.     CommandT            mCmdToManage;
  89.     ResIDT                mWindowMenuID;
  90.     static Int16        sDecalItem;
  91.     LDocument            *mDocument;
  92.     
  93.     virtual void        ExecuteSelf(MessageT inMessage, void *ioParam);
  94. };
  95.  
  96.  
  97. // ===========================================================================
  98. // • LStackCmdAttachment                                 LStackCmdAttachment •
  99. // ===========================================================================
  100.  
  101. class    LStackCmdAttachment : public LAttachment {
  102.  
  103. protected:
  104.     
  105.     virtual void        ExecuteSelf(MessageT inMessage, void *ioParam);
  106. };
  107.  
  108.  
  109.